package eu.webhib.frmwrk.domain.intf;

import java.util.*;

/**
 * Base type of entities with parent/child relationship
 * @param <T> type of the parent/child related entity itself
 */
public interface ParentChildEntity<T extends ParentChildEntity<T>> extends BaseEntity {

   /**
    * Get the parent of this entity
    */
   T getParent();

   /**
    * Set the parent of this entity
    */
   void setParent(T parent);

   /**
    * Get all children of this entity
    */
   List<T> getChildren();

   /**
    * Remove all children
    */
   void clearChildren();
}
